﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PowerWaveAddin
{
    public partial class PublishStatusForm : Form
    {
        public delegate void AppendStringToReportDelegate(string str);
        private AppendStringToReportDelegate appendDelegateImpl;
        public AppendStringToReportDelegate AppendStringToReportDelegateWrapper
        {
            get { return appendDelegateImpl; }
            private set { appendDelegateImpl = value; }
        }

        public delegate void UpdateProgressBarDelegate(int percentage);
        public UpdateProgressBarDelegate ProgressBarDelegateWrapper { get; set; }

        public PublishStatusForm()
        {
            InitializeComponent();
            this.appendDelegateImpl = new AppendStringToReportDelegate(AppendStringToReport);
            this.ProgressBarDelegateWrapper = new UpdateProgressBarDelegate(UpdateStatusPercentage);
        }

        private void UpdateStatusPercentage(int percent)
        {
            this.PublishProgressBar.Value = percent;
        }

        public void AppendStringToReport(string str)
        {
            this.statusText.Text += str;
        }
    }
}
